﻿using System;
using System.ComponentModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
namespace XXS.Common.Paginate
{

    public class PaginateModel
    {
        private int _page = 1;
        private readonly string _sort = string.Empty;

        [DefaultValue(1)]
        public int Page
        {
            get => _page;
            set => _page = value <= 0 ? 1 : value;
        }

        [DefaultValue(25)]
        public int PageSize { get; set; } = 20;

        public int Start { get; set; }

        public int Limit
        {
            get => PageSize;
            set => PageSize = value;
        }

        public bool IsPaginated { get; set; }

    }
}
